package com.test.resumeanalysis.ui.talent.talent_info

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.test.resumeanalysis.App.App
import com.test.resumeanalysis.data.model.resume.ResumeParse
import com.test.resumeanalysis.data.repository.ResumeRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class TalentInfoViewModel : ViewModel() {

    private val dao = App.dataBase.resumeDao()
    private val _ResumeMutableLiveData = MutableLiveData<Int>()
    private val resumeRepository = ResumeRepository()
    val ResumeLiveData = Transformations.switchMap(_ResumeMutableLiveData) { position ->
        resumeRepository.getResume(position)
    }

    fun getResumeByPosition(position: Int) {

        _ResumeMutableLiveData.value = position
    }

}
